As a relatively new Scala developer I often find myself hunting for the the correct imports to enable various implicit
conversions.
A particularly useful set of implicit conversions are those that convert an Int / Long / Double to a FiniteDuration.
They allow you to write code like:
val timeout1 = 3 seconds
val timeout2 = 3.5 minutes
To enable this syntax you need to import one or more of the following:
import scala.concurrent.duration.{DurationInt, DurationLong, DurationDouble}
No comments:
Post a Comment